// 以房东把房子租出去为例理解代理模式
#include<iostream>
#include<string>

class RentHouse
{
    public:
    virtual void renthouse()=0;
};
class Landlord:public RentHouse
{
    public:
    void renthouse() override
    {
        std::cout<<"把房子租出去"<<std::endl;
    }
};

//中介
class Intermediary:public RentHouse
{
    public:
    void renthouse()override
    {
         std::cout<<"发布招租信息"<<std::endl;
    std::cout<<"带人看房"<<std::endl;
    landord_.renthouse();
    std::cout<<"租后维修"<<std::endl;
    }
   

    private:
    Landlord landord_;
};

int main()
{
    Intermediary intermediary;
    intermediary.renthouse();
    return 0;
}